package com.bw.zhuangao5___day002.Fragment.Home.Fragment2;




import com.bw.mvp.M.BannerModel;

import java.util.List;

import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;

/**
 * create by ertu
 * create on 2021/9/22
 * description
 */
public class MainModel extends BannerModel implements MainContions.miismode{


    @Override
    public void getmissmodel(MainCallbck mainCallbck) {
        MainOkhttps.getOkhttpboos().retrofit().create(MainApi.class).getkaishi()
                .observeOn(AndroidSchedulers.mainThread())
                .subscribeOn(Schedulers.io())
                .subscribe(new Observer<JavaMain>() {
                    @Override
                    public void onSubscribe(Disposable d) {

                    }

                    @Override
                    public void onNext(JavaMain javaMain) {
                        List<JavaMain.ResBean.AvatarBean> dataBeans = javaMain.getRes().getAvatar();
                        mainCallbck.chenggong(dataBeans);
                    }

                    @Override
                    public void onError(Throwable e) {

                    }

                    @Override
                    public void onComplete() {

                    }
                });
    }
}
